program Test_my_taylor
use polymorphic_complextaylor
type(TAYLOR) L1,K1,L2,K2,L0,K0,x(2)
!real(dp) L1,K1,L2,K2,x(2),L0,K0

CALL INIT(3,1,0,0)

CALL ALLOC(L1,K1,L2,K2,L0,K0)
CALL ALLOC(X)
N=10
L1=0.25D0
K1=20.0D0
L2=0.2D0
K2=-k1
L0=0.1d0
K0=0.D0

X(1)=0.D0;X(2)=0.D0;

X(1)=X(1) +(1.0_DP.mono.1)
X(2)=X(2) +(1.0_DP.mono.2)



DO I=1,10
 CALL QUAD_MY_TAYLOR(X,L1,K1,N)
 CALL QUAD_MY_TAYLOR(X,L0,K0,N)
 CALL QUAD_MY_TAYLOR(X,L2,K2,N)
 CALL QUAD_MY_TAYLOR(X,L0,K0,N)
ENDDO

CALL PRINT( X(1),6)
CALL PRINT( X(2),6)

CALL KILL(L1,K1,L2,K2,L0,K0)
CALL KILL(X)

end program Test_my_taylor


SUBROUTINE QUAD_MY_TAYLOR(X,L,K,N)
USE polymorphic_complextaylor
IMPLICIT NONE
INTEGER N,I
TYPE(TAYLOR) K,L,X(2),DL
!real(dp) K,L,X(2),DL

CALL ALLOC(DL)

DL=L/N

DO I=1,N

X(1)=X(1)+DL*X(2)/SQRT(1.D0-X(2)**2)
X(2)=X(2)-DL*K*X(1)
ENDDO

CALL KILL(DL)

END SUBROUTINE QUAD_MY_TAYLOR